/*
 * @Author: long-xinyu2 2192763423@qq.com
 * @Date: 2025-05-20 10:52:08
 * @LastEditors: long-xinyu2 2192763423@qq.com
 * @LastEditTime: 2025-05-20 11:46:16
 * @FilePath: \algorithm-training\xx.cpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 998244353;
typedef long long LL;

const int N = 110;

pair<int,int> match[N][N];
bool st[N][N];
bool g[N][N];

int dx[4] = {0,1,0,-1}; 
int dy[4] = {1,0,-1,0};
int n;

int find(int x,int y)
{
    for(int i = 0; i < 4; i ++)
    {
        int a = x + dx[i];
        int b = y + dy[i];
        if(a > n || b > n || a < 1 || b < 1 || g[a][b] == true) continue;
        if(!st[a][b]){
            st[a][b] = true;
            pair<int,int> t = match[a][b];
            if(t.first == 0 && t.second == 0 || find(t.first,t.second)){
                match[a][b] = {x,y};
                return true;
            }
        }
    }
    return false;
}

void solve(){
    cin >> n;
    int q;
    cin >> q;
    for(int i = 1; i <= q; i ++)
    {
        int a,b;
        cin >> a >> b;
        g[a][b] = true;
    }
    int res = 0;
    for(int i = 1; i <= n; i ++)    
    {
        for(int j = 1; j <= n; j ++)
        {
            if(i % 2 == 0 && j % 2 == 1 || i % 2 == 1 && j % 2 == 0)
            {
                if(!g[i][j])
                {
                    memset(st, false, sizeof st);
                    if(find(i,j)) res ++;
                }
            }
        }
    }
    cout << res << endl;
}
signed main(){
    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
}